package com.changgou.goods.feign;

import com.changgou.entity.PageResult;
import com.changgou.entity.Result;
import com.changgou.goods.pojo.Template;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "goods")
public interface TemplateFeign {

    @PostMapping("/template/search/{page}/{size}" )
    public Result<PageResult> findPage(@RequestParam Map searchMap, @PathVariable("page") int page, @PathVariable("size") int size);

    @PostMapping("/template")
    public void add(@RequestBody Template template);

    @GetMapping("/template/{id}")
    public Result<Template> findById(@PathVariable("id") Integer id);

    @PutMapping("/template/{id}")
    public void update(@RequestBody Template template,@PathVariable("id") Integer id);

    @DeleteMapping("/template/{id}" )
    public Result delete(@PathVariable("id") Integer id);
}
